package Background;

import java.util.ArrayList;

/**
 * A child class of the user.  This class describes a contestant, or a user who is submitting
 * an entry.
 * 
 * @author Chris Petcher
 * @version 1/30/2013
 * 
 */

public class Contestant extends User{
	

	/**
	 * A boolean to determine if the contestant accepted the sponsor release.
	 */
	
	public boolean accept = false;
	
	/**
	 * An entry object.  The contestant can have 3 of these.
	 */
	
	private Entry entry_1;
	
	/**
	 * An entry object.  The contestant can have 3 of these.
	 */
	
	private Entry entry_2;

	/**
	 * An entry object.  The contestant can have 3 of these.
	 */
	
	private Entry entry_3;
	
	/**
	 * An arrayList that holds a list of designs.
	 */
	
	private ArrayList<Entry> entryList = new ArrayList<Entry>();
	
	/**
	 * An int value to hold the contestant's registration number.
	 */
	
	public int registration_number;
	
	public Contestant()
	{
		super();
	}
	
	/**
	 * Constructor for the user who is a contestant.  Sends the incoming arguments to the 
	 * super for use in that constructor.  Also adds the contestant to the entry list.  
	 * @param name The first and last name of the contestant.
	 * @param email The email provided by the contestant upon registration.
	 * @param confirm A variable used to confirm the email address.
	 * @param userName The user name chosen by the contestant upon registration.
	 * @param password The password chosen by the contestant upon registration.
	 * @param number The phone number provided by the contestant upon registration.
	 */

	public Contestant(final String name, final String email, final String confirm, 
			final String username, final String password, final String number, final int reg) {
		super(name, email, confirm, username, password, number, true);
		registration_number = reg;
		entry_1 = new Entry("No Entry", null);
		entry_1.setDescription("No Entry");
		entry_2 = new Entry("No Entry", null);
		entry_2.setDescription("No Entry");
		entry_3 = new Entry("No Entry", null);
		entry_3.setDescription("No Entry");

		addContestant(this);
	}

	/**
	 * A setter for the first entry of this contestant.
	 * @param first_entry The first Entry entered by the contestant.
	 */
	
	public void setEntry1(final Entry first_entry){
		entry_1 = first_entry;
	}

	/**
	 * A setter for the second entry of this contestant.
	 * @param second_entry The second Entry entered by the contestant.
	 */
	
	public void setEntry2(final Entry second_entry){
		entry_2 = second_entry;
	}
	
	/**
	 * A setter for the third entry of this contestant.
	 * @param third_entry The third Entry entered by the contestant.
	 */
	
	public void setEntry3(final Entry third_entry){
		entry_3 = third_entry;
	}
	
	/**
	 * Getter for the first entry submitted by this contestant.
	 * @return The first entry.
	 */
	
	public Entry getEntry1(){
		return entry_1;
	}

	/**
	 * Getter for the second entry submitted by this contestant.
	 * @return The second entry.
	 */
	
	public Entry getEntry2(){
		return entry_2;
	}

	/**
	 * Getter for the third entry submitted by this contestant.
	 * @return The third entry.
	 */
	
	public Entry getEntry3(){
		return entry_3;
	}
	
	/**
	 * Adds a design to the entry list.
	 * @param design The design to add to the list.
	 */
	
	public void addEntryToList(final Entry the_entry){
		entryList.add(the_entry);
	}
	
	/**
	 * Gets the list of all the entries. 
	 * @return The list of all the entries.
	 */
	
	public ArrayList<Entry> getEntryList(){
		return entryList;
	}
	
	/**
	 * Get's this contestant's registration number.
	 * @return registration_number The contestant's registration number.
	 */
	
	public int getRegistrationNumber(){
		return registration_number;
	}

}
	